package java.util;

import java.lang.reflect.Field;

/**
 * @program: fc-redis->Test
 * @description: test
 * @author: G_Y
 * @create: 2019-09-14 19:42
 **/
public class Test {

    // 异常java.lang.SecurityException: Prohibited package name: java.util
    public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException {
        HashMap<Integer,String> map = new HashMap<>(3);
        Class<? extends HashMap> aClass = map.getClass();
        Field declaredField = aClass.getDeclaredField("table");
        declaredField.setAccessible(true);
        HashMap.Node<Integer,String>[] o = (HashMap.Node<Integer, String>[]) declaredField.get(map);
        System.out.println(o.length);
    }

}
